package dongze.com.ckdj.adapter;

/**
 * Created by renxiaoxiao on 2017/8/18.
 */

public class EnclosureListItem {
    String chText;
    String enText;
    Type type;
    int sort;

    public EnclosureListItem(String chText, String enText, Type type, int sort) {
        this.chText = chText;
        this.enText = enText;
        this.type = type;
        this.sort = sort;
    }

    public String getChText() {
        return chText;
    }

    public void setChText(String chText) {
        this.chText = chText;
    }

    public String getEnText() {
        return enText;
    }

    public void setEnText(String enText) {
        this.enText = enText;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public static enum Type {
        CHECKBOX,EDITTEXT,;

        public static Type getTypeFromData(int  program_type) {
            switch (program_type) {
                case 2:
                    return EDITTEXT;
                case 1:
                    return CHECKBOX;

                default:
                    return CHECKBOX;
            }
        }

        public int toData() {
            switch (this) {
                case EDITTEXT:
                    return 2;

                case CHECKBOX:
                    return 1;

                default:
                    return 1;
            }
        }
    }
}
